package me.zk.practice1.s;

/**
 * @author zhangkai
 * @date 2023/7/13 11:29
 */
public class LS_Offer_24 {
    public ListNode reverseList(ListNode head) {
        ListNode pre = null;
        ListNode current = null;
        while (head != null) {
            current = head;
            head = head.next;
            current.next = pre;
            pre = current;
        }
        return current;
    }
}
